package com.mouse.hxsj.constants;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mouse.hxsj.dao.SystemParamMapper;
import com.mouse.hxsj.entity.po.SystemParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class SystemParams {
    public static String sourcePath = "D:/damo";
    public static String exePath = "D:/腾讯游戏/qq幻想世界/qqhxsj.exe";
    public static boolean autoYzm = true;
    @Autowired
    private SystemParamMapper systemParamMapper;

    @PostConstruct
    public void init() {
        SystemParam systemParam0 = systemParamMapper.selectOne(new LambdaQueryWrapper<SystemParam>().eq(SystemParam::getType, 0));
        sourcePath = systemParam0.getName();
        SystemParam systemParam1 = systemParamMapper.selectOne(new LambdaQueryWrapper<SystemParam>().eq(SystemParam::getType, 1));
        exePath = systemParam1.getName();
    }
}
